using System;
using EnvDTE;

namespace NUnitGenAddIn.Core.Test
{
    /// <summary>
    /// Mock Code Element
    /// </summary>
	public class MockCodeElement : CodeElement
	{
		private string _name = "";
		protected CodeElements children;

        /// <summary>
        /// Gets the mock children.
        /// </summary>
        /// <value>The mock children.</value>
		public CodeElements MockChildren
		{
			get { return children; }
		}

        /// <summary>
        /// Initializes a new instance of the <see cref="MockCodeElement"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
		public MockCodeElement(string name)
		{
			_name = name;
		}

        /// <summary>
        /// Initializes a new instance of the <see cref="MockCodeElement"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="children">The children.</param>
		public MockCodeElement(string name, CodeElements children) : this(name)
		{
			this.children = children;
			((MockCodeElements) this.children).Parent = this;
			foreach (MockCodeElement e in this.children)
			{
				e.Parent = this;
			}
		}

		#region CodeElement Members

        /// <summary>
        /// Gets the children.
        /// </summary>
        /// <value>The children.</value>
		public virtual CodeElements Children
		{
			get { throw new Exception("The method or operation is not implemented."); }
		}

        /// <summary>
        /// Gets the collection.
        /// </summary>
        /// <value>The collection.</value>
		public virtual CodeElements Collection
		{
			get { throw new Exception("The method or operation is not implemented."); }
		}

        /// <summary>
        /// Gets the DTE.
        /// </summary>
        /// <value>The DTE.</value>
		public virtual DTE DTE
		{
			get { throw new Exception("The method or operation is not implemented."); }
		}

        /// <summary>
        /// Gets the end point.
        /// </summary>
        /// <value>The end point.</value>
		public virtual TextPoint EndPoint
		{
			get { throw new Exception("The method or operation is not implemented."); }
		}

        /// <summary>
        /// Gets the extender CATID.
        /// </summary>
        /// <value>The extender CATID.</value>
		public virtual string ExtenderCATID
		{
			get { throw new Exception("The method or operation is not implemented."); }
		}

        /// <summary>
        /// Gets the extender names.
        /// </summary>
        /// <value>The extender names.</value>
		public virtual object ExtenderNames
		{
			get { throw new Exception("The method or operation is not implemented."); }
		}

        /// <summary>
        /// Gets the full name.
        /// </summary>
        /// <value>The full name.</value>
		public virtual string FullName
		{
			get { throw new Exception("The method or operation is not implemented."); }
		}

        /// <summary>
        /// Gets the end point.
        /// </summary>
        /// <param name="Part">The part.</param>
        /// <returns></returns>
		public virtual TextPoint GetEndPoint(vsCMPart Part)
		{
			throw new Exception("The method or operation is not implemented.");
		}

        /// <summary>
        /// Gets the start point.
        /// </summary>
        /// <param name="Part">The part.</param>
        /// <returns></returns>
		public virtual TextPoint GetStartPoint(vsCMPart Part)
		{
			throw new Exception("The method or operation is not implemented.");
		}

        /// <summary>
        /// Gets the info location.
        /// </summary>
        /// <value>The info location.</value>
		public virtual vsCMInfoLocation InfoLocation
		{
			get { throw new Exception("The method or operation is not implemented."); }
		}

        /// <summary>
        /// Gets a value indicating whether this instance is code type.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is code type; otherwise, <c>false</c>.
        /// </value>
		public virtual bool IsCodeType
		{
			get { throw new Exception("The method or operation is not implemented."); }
		}

        /// <summary>
        /// Gets the kind.
        /// </summary>
        /// <value>The kind.</value>
		public virtual vsCMElement Kind
		{
			get { throw new Exception("The method or operation is not implemented."); }
		}

        /// <summary>
        /// Gets the language.
        /// </summary>
        /// <value>The language.</value>
		public virtual string Language
		{
			get { throw new Exception("The method or operation is not implemented."); }
		}

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>The name.</value>
		public virtual string Name
		{
			get { return _name; }
			set { _name = value; }
		}

        /// <summary>
        /// Gets the project item.
        /// </summary>
        /// <value>The project item.</value>
		public virtual ProjectItem ProjectItem
		{
			get { throw new Exception("The method or operation is not implemented."); }
		}

		private readonly MockTextPoint _startPoint = new MockTextPoint(0, 0);

        /// <summary>
        /// Gets the start point.
        /// </summary>
        /// <value>The start point.</value>
		public virtual TextPoint StartPoint
		{
			get { return _startPoint; }
		}

        /// <summary>
        /// Get_s the extender.
        /// </summary>
        /// <param name="ExtenderName">Name of the extender.</param>
        /// <returns></returns>
		public virtual object get_Extender(string ExtenderName)
		{
			throw new Exception("The method or operation is not implemented.");
		}

		#endregion

        /// <summary>
        /// Gets or sets the parent.
        /// </summary>
        /// <value>The parent.</value>
	    public object Parent { get; set; }
	}
}